﻿using System.Net;
using System.Net.NetworkInformation;

namespace Nextensions.Net
{
    public static class PingTool
    {
        public static int Timeout = 2000;

        public static bool Ping(string Address)
        {
            return Ping(Address, Timeout);
        }

        public static bool Ping(string address, int timeout)
        {
            Ping ping = new Ping();
            PingReply reply = ping.Send(address, timeout);
            return reply.Status == IPStatus.Success;
        }
    }
}
